package es.uned.hoomgle.core.dtos;

import es.uned.hoomgle.hibernate.beans.interfaces.CityI;
import es.uned.hoomgle.hibernate.beans.interfaces.HomeI;
import es.uned.hoomgle.hibernate.beans.interfaces.UserI;

public class HomeDto implements HomeI {
	
	
	
	
	private Integer id;

    private Integer area;

	private CityI city;
	
	private Integer cost;
	
	private UserI user;

	private boolean hasGarden;
	
	private String description;
	
	private byte[] picture;
	
	public HomeDto() {
		super();
		user = new UserDto();
		city = new CityDto();
		city.setState(new StateDto());
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the area
	 */
	public Integer getArea() {
		return area;
	}
	/**
	 * @param area the area to set
	 */ 
	
	public void setArea(Integer area) {
		this.area = area;
	}
	
	/**
	 * @return the cost
	 */
	public Integer getCost() {
		return cost;
	}
	
	/**
	 * @param cost the cost to set
	 */
	public void setCost(Integer cost) {
		this.cost = cost;
	}
	/**
	 * @return the hasGarden
	 */
	public boolean isHasGarden() {
		return hasGarden;
	}

	/**
	 * @param hasGarden the hasGarden to set
	 */
	public void setHasGarden(boolean hasGarden) {
		this.hasGarden = hasGarden;
	}
	
	
	
	public UserI getUser() {
		return user;
	}
	public void setUser(UserI user) {
		//if(user instanceof UserDto){
			this.user = user;
		//}		
	}
	
	
	public byte[] getPicture() {
		return picture;
	}
	public void setPicture(byte[] picture) {
		this.picture = picture;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("HomeDto [id=");
		builder.append(id);
		builder.append(", area=");
		builder.append(getArea());
		builder.append(", city=");
		builder.append(city);
		builder.append(", cost=");
		builder.append(cost);
		builder.append(", user=");
		builder.append(user);
		builder.append(", hasGarden=");
		builder.append(hasGarden);
		builder.append("]");
		return builder.toString();
	}
	
	@Override
	public CityI getCity() {
		return this.city;
	}
	
	@Override
	public void setCity(CityI city) {
		this.city=city;
	}

}

